package com.wqtz.chechai.adapter;

import android.view.View;

import com.wqtz.chechai.R;
import com.wqtz.chechai.base.lvbaseadapter.LvBaseAdapter;
import com.wqtz.chechai.base.lvbaseadapter.ViewHolder;

import java.util.List;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/29 14:36
 */

public class TimeAdapter extends LvBaseAdapter<String> {
	public TimeAdapter(int resId) {
		super(resId);
	}

	itemClickCallBack mBack;

	public void setCallBack(itemClickCallBack mBack) {
		this.mBack = mBack;
	}

	@Override
	public void bindDatas(List<String> list, final int position, ViewHolder holder) {
		holder.setText(R.id.content, list.get(position));
		holder.getViewHolder().setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				mBack.itemClick(position);
			}
		});
	}

	public interface itemClickCallBack {
		void itemClick(int position);
	}
}
